package com.lzg;

/**
 * @Author lizhigang Date: 2019/9/12 14:48
 * @description:
 */
public class StrategyDemo {

	public static void main(String[] args) {
		Bill bill = new Bill();
		bill.addItems(new Item("java编程思想",10000));
		bill.addItems(new Item("java高并发变成详解",30000));
		bill.pay(PaymentFactory.getPayment("DEBIT"));//简单工厂创建对象
//		bill.pay(Card.payStrategy.get("CREDIT")); 通过spring 注入的方式提前初始化对象到Map中
	}
}
